<?php 
$jobdir = $_['jobsdir'];
list($folderSearch, $selected) = PResumesHelper::getSearchItemHref(OCP\Util::linkToRoute('jobpos_search'), 'jobdir', $jobdir);
?>
<ul>
   <li class="<?php echo $jobdir == "all" ? "cur_li" : ""; ?>">
      <a href="<?=OC_Helper::linkToRoute('jobpos_folder', array('jobdir' => 'all'))?>"><?=PFactory::isMasterUser() ? '全部职位' : '我的职位'?></a>
   </li>
   <li class="<?php echo $jobdir == "saved" ? "cur_li" : ""; ?>">
      <a href="<?=OC_Helper::linkToRoute('jobpos_folder', array('jobdir' => 'saved'))?>">我的收藏</a>
   </li>
   <?php 
   $moreselected = true;
   $moreFolderName = '';
   switch ($jobdir) {
      case 'all':
      case 'saved':
         $moreselected = false;
         break;
      case 'trashed':
         $moreFolderName = '回收站';
         break;
      case 'subcompany':
         $moreFolderName ='公司职位';
         break;
      default:
         if (is_numeric($jobdir)) {
            $dirInfo = PJobpositionHelper::getDirInfo($jobdir);
            if (empty($dirInfo)) {
               $foldername = JRequest::getString('foldername', null);
               $moreFolderName = $foldername ? $foldername : '';
            } else {
               $moreFolderName = $dirInfo['foldername'];
            }
         }
         break;
   }
   ?>
   <li id="more_folder" class="<?php echo $moreselected ? "cur_li" : "";?> dropdown" data-searchurl="<?=PJobpositionHelper::getSearchUrl()?>">
      <a id="selectmore_folder" class="dropdown-toggle" href="javascript:;"><b><?=(empty($moreFolderName) ? '文件夹' : strmaxtextlen($moreFolderName, 8))?></b> <i class="blue_triangle"></i></a>
      <div id="folder_dropdown" class="folder_option dropdown-menu popup" data-searchurl="<?=$folderSearch?>"></div>
   </li>
</ul>
